#include <stdio.h>
#include <stdint.h>
#include "func.h"
#include "thread"
#include <iostream>
#include <cstring>
#include "ut/ut_test.h"



void TestFunc()
{
    printf("start to TestFunc\n");

    int c = add(1,2);

    return;    
}

void TestFunc2()
{
    printf("start to TestFunc2\n");

    return; 
}


int32_t main()
{
    printf("hello world\n");

    TestFunc();

    do {
        printf("input q or Q to exit:\n");
        printf("\t a: test:\n");
        printf("\t b: TestEventLoopThreadStart:\n");
        printf("\t c: TestEventLoopThreadStop:\n");
        printf("\t d: TestEventLoopThreadFunc:\n");
        printf("\t e: TestTcpServerStart:\n");
        printf("\t f: TestTcpServerStop:\n");
        printf("\t g: TestTcpClinetStart:\n");
        printf("\t h: TestTcpClinetStop:\n");

        std::string input;
        std::cin >> input;

        if ("q" == input || "Q" == input) {
            break;
        } else if ("a" == input) {
            TestFunc2();
        } else if ("b" == input) {
            TestEventLoopThreadStart();
        } else if ("c" == input) {
            TestEventLoopThreadStop();
        } else if ("d" == input) {
            TestEventLoopThreadFunc();
        } else if ("e" == input) {
            TestTcpServerStart();
        } else if ("f" == input) {
            TestTcpServerStop();
        } else if ("g" == input) {
            TestTcpClinetStart();
        } else if ("h" == input) {
            TestTcpClinetStop();
        } 
        std::this_thread::sleep_for(std::chrono::milliseconds(1000));
    } while (1);

    return 0;
}
